{include admin.inc.header}

{include admin.inc.top}

<div class="container-fluid content-body">
    <div class="main">
        {include admin.inc.menu}

        <section class="right-section" id="right-section">
            <!-- start of inner-frame -->
            <div class="inner-iframe">

                {include admin.inc.bread}

                <!-- Nav tabs -->
                <ul class="nav nav-tabs">
                    {loop $__sysmenus[$menu_key][subs] $k $v}
                    <li{if $v[id]==$menu_id} class="active"{/if}><a href="{if $v[id]==$menu_id}javascript:;{else}/{$v[url]}{/if}"><i class="glyphicon glyphicon-th-list"></i> {$v[name]}</a></li>
                    {/loop}
                </ul>

                <div class="inner-container">
                    <form class="form-inline form-search" role="form" id="search-form">
                        <nav class="inline-form clearfix">
                            <div class="r">
                                <div class="form-group">
                                    <div class="input-group">
                                        <div class="input-group-addon">
                                            日期
                                        </div>
                                        <input style="width:100px;" class="form-control form-control-inline input-sm mdate"
                                               size="16" type="text"
                                               name="start_time" value="{$search_arr[start_time]}"
                                               placeholder="开始时间"/>

                                        <div class="input-group-addon">
                                            -
                                        </div>
                                        <input style="width:100px;" class="form-control form-control-inline input-sm mdate"
                                               size="16" type="text"
                                               name="end_time" value="{$search_arr[end_time]}"
                                               placeholder="结束时间"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <select name="appid"  class="form-control input-sm">
                                        <option value="">租户标识</option>
                                        {loop $app_idoptions $v}
                                        <option value="{$v[id]}">{$v[company]}</option>
                                        {/loop}

                                    </select>
                                </div>
                                <script>
                                    var select_mix_option1 = "{$search_arr[select_mix_option1]}";


                                    if (select_mix_option1) {
                                        $("select[name='select_mix_option1']").val(select_mix_option1);
                                    }

                                    var appid="{$search_arr[appid]}";

                                    if(appid){$("select[name='appid']").val(appid);}

                                </script>
                                <button type="submit" class="btn btn-sm btn-success">搜索</button>
                                {data_export_btn}
                            </div>
                        </nav>

                        <!-- search form end -->
                    </form>
                    <form id="J_List_Form" autocomplete="off">

                        <div class="table-responsive" style="overflow-x: visible;">
                            <table class="table table-bordered table-hover" id="J_List_Table">
                                <!--tmpl-listtable-->

                                <!-- listblock -->
                                <thead>
                                <tr>
                                    <th width="20"><input type="checkbox" class="icheck check-all"/></th>
                                    {loop $tableHeader $val}
                                    <th>{$val}</th>
                                    {/loop}

                                </tr>
                                </thead>
                                <tbody>
                                {if empty($items)}
                                <tr>
                                    <td class="no-records text-center">{$noRecords}</td>

                                </tr>
                                {/if}
                                {loop $items $k $value}
                                <tr>
                                    <td><input type="checkbox" class="icheck" name="ids[]" value="{$value[id]}"/></td>
                                    <!--tmpl-fieldlist-->

                                    <td>{$value[that_day]}</td>
                                    <td>{$value[company_name]}</td>
                                    <td>{$value[sales_price]}</td>
                                    <td>{$value[cost_price]}</td>
                                    <td>{$value[profit]}</td>
                                    <td>
                                        <?php

                                        echo
                                        '<a href="details?start_time='.$value[that_day].'&end_time='.$value[that_day].'&appid='.$value[app_id].'">详情</a>';
                                        ?>

                                    </td>
                                </tr>
                                {/loop}


                            </table>

                        </div>
                    </form>

                    <div class="text-right">
                        {$pagemenu}
                    </div>

                </div>

            </div><!-- end of inner -->
        </section>

    </div>
</div>

{include admin.inc.footer}

<script type="text/html" id="content-add-template">
    <form role="form" class="content-add-form" id="content-add-form" autocomplete="off">

        <div class="form-element">
            <div class="form-group">
                <label><span class="asterisk">*</span> 上级分类</label>
                <select class="form-control select2" name="data[pid]">
                    <option value="0">顶级分类</option>
                    {loop $ftypes $value}
                    <option value="{$value[id]}" {[if item.pid== {$value[id]} ]}selected{[
                    /if]}>{$value[name]}</option>
                    {/loop}
                </select>
            </div>
            <p class="help-block"></p>
        </div>

        <div class="form-element">
            <div class="form-group">
                <label><span class="asterisk">*</span> 分类名称</label>
                <input type="text" name="data[name]" value="{[item.name]}" class="form-control" maxlength="15"
                       placeholder="分类名称" required/>
            </div>
            <p class="help-block"></p>
        </div>

        <div class="form-element">
            <div class="form-group">
                <label>分类说明</label>
                <textarea name="data[summary]" class="form-control" placeholder="这里输入分类说明">{[item.summary]}</textarea>
            </div>
            <p class="help-block"></p>
        </div>

        <div class="form-element">
            <div class="form-group">
                <label>分类状态</label>
                <div class="bootstrap-switch-swrap">
                    <input type="checkbox" class="bswitch bswitch-list" data-size="mini"  {[if item.status== 1]}checked{[/if]}
                    data-on-text="启用" data-off-text="禁用">
                    <input type="hidden" name="data[status]" value="{[item.status]}">
                </div>
            </div>
            <p class="help-block"></p>
        </div>

        <input type="hidden" name="id" value="{[item.id]}">
    </form>
</script>

<script>
    seajs.use("productType", function (exports) {
        exports.init({
            set_url: '/admin/productType/set/',
            insert_url: '{$insert_url}',
            edit_url: '{$edit_url}',
            update_url: '{$update_url}',
        });
    });
</script>
</body>
</html>
